From e058d8bfc50dfa37bfdc1cb4ca010760046da2c2 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 4 Jul 2005 17:41:43 +0000 Subject: [PATCH] From Eteinne. RCS file: /cvsroot/gpsbabel/gpsbabel/vitosmt.c,v I've found one of my valid vitosmt file fails the integrity test. I relaxed the validation a little. RCS file: /cvsroot/gpsbabel/gpsbabel/waypt.c,v Set some default values for new waypoint members. RCS file: /cvsroot/gpsbabel/gpsbabel/lowranceusr.c,v Discovered that the lowrance.c arg list is not null-terminated, causing a GPF in exit_vecs . --- internal_styles.c | 2 ++ lowranceusr.c | 3 ++- vitosmt.c | 5 +---- waypt.c | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal_styles.c b/internal_styles.c index 49efddea3..706fbdace 100644 --- a/internal_styles.c +++ b/internal_styles.c @@ -389,6 +389,8 @@ static char s_and_t[] = "#\n" "DESCRIPTION Microsoft Streets and Trips 2002-2005\n" +"EXTENSION txt\n" + "#\n" "# FILE LAYOUT DEFINITIIONS:\n" diff --git a/lowranceusr.c b/lowranceusr.c index ace7f0890..9169b46bf 100644 --- a/lowranceusr.c +++ b/lowranceusr.c @@ -228,7 +228,8 @@ arglist_t lowranceusr_args[] = { {"merge", &merge, "(USR output) Merge into one segmented track", NULL, ARGTYPE_BOOL }, {"break", &seg_break, "(USR input) Break segments into separate tracks", - NULL, ARGTYPE_BOOL } + NULL, ARGTYPE_BOOL }, + {NULL, NULL, NULL, NULL, 0} }; static void diff --git a/vitosmt.c b/vitosmt.c index 562aeab04..e8d4878b8 100644 --- a/vitosmt.c +++ b/vitosmt.c @@ -125,7 +125,6 @@ vitosmt_read(void) unsigned char gpsvalid =0; unsigned char gpssats =0; int serial =0; - xml_tag * xml_curr =0; char buffer[80] ="\0"; @@ -136,7 +135,7 @@ vitosmt_read(void) subversion = ReadLong(infile); /* 1000 */ count = ReadLong(infile); /* n */ check1 = ReadLong(infile); /* 0 */ - check2 = ReadLong(infile); /* n-1 */ + check2 = ReadLong(infile); /* not sure */ check3 = ReadLong(infile); /* n */ if (version!=vitosmt_version) { @@ -152,7 +151,6 @@ vitosmt_read(void) if ((count!=check3) || (check1!=count-1) || - (check2!=0) || (check3!=count) ) { fatal("%s (%d) reading file. Invalid file header\n", @@ -277,7 +275,6 @@ vitosmt_waypt_pr(const waypoint *waypointp) struct tm* tmstructp =0; double seconds =0; double worknum =0; - xml_tag* xmltagp =0; ++count; workbuffer = xcalloc(vitosmt_datasize,1); diff --git a/waypt.c b/waypt.c index 87731cd66..a8a179b8b 100644 --- a/waypt.c +++ b/waypt.c @@ -138,6 +138,8 @@ waypt_new(void) wpt->altitude = unknown_alt; wpt->course = -999.0; wpt->speed = -999.0; + wpt->fix = fix_unknown; + wpt->sat = -1; return wpt; } -- 2.30.2